import request from "@/utils/request";

/**
 * 分类接口
 */
export function articleCate(data) {
  return request({
    url: '/article/category',
    method: 'post',
    data
  })
}

/**
 * 分类显示控制接口
 */
export function articleCateChange(data) {
  return request({
    url: '/article/category/change',
    method: 'post',
    data
  })
}

/**
 * 分类更新接口
 */
export function articleCateUpdate(data) {
  return request({
    url: '/article/category/update',
    method: 'post',
    data
  })
}

/**
 * 分类删除接口
 */

export function articleCateDelete(data) {
  return request({
    url: '/article/category/delete',
    method: 'post',
    data
  })
}

/**
 * 标签接口
 */
export function articleTag(data) {
  return request({
    url: '/article/tag',
    method: 'post',
    data
  })
}

/**
 * 标签显示控制接口
 */
export function articleTagChange(data) {
  return request({
    url: '/article/tag/change',
    method: 'post',
    data
  })
}

/**
 * 标签更新接口
 */
export function articleTagUpdate(data) {
  return request({
    url: '/article/tag/update',
    method: 'post',
    data
  })
}

/**
 * 标签删除接口
 */

export function articleTagDelete(data) {
  return request({
    url: '/article/tag/delete',
    method: 'post',
    data
  })
}

// 添加文章接口
export const articleSave = (data) => {
  return request({
    url: '/article/save',
    method: 'POST',
    data
  })
}

// 文章列表接口
export const articleList = (data) => {
  return request({
    url: '/article/list',
    method: 'post',
    data
  })
}

// 文章置顶
export const articleTopChange = (data) => {
  return request({
    url: '/article/top/change',
    method: 'POST',
    data
  })
}

// 文章发表
export const articlePublishChange = (data) => {
  return request({
    url: '/article/publish/change',
    method: 'POST',
    data
  })
}

// 文章详情
export const articleDetail = (id) => {
  return request({
    url: `/article/${id}`,
  })
}

// 文章删除
export const articleDelete = (id) => {
  return request({
    url: `/article/delete/${id}`
  })
}
